﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using Newtonsoft.Json;
using System.Data.Entity.Infrastructure;
using _24_Hour_Blogger.Models;
using _24_Hour_Blogger.Models.Content;
using _24_Hour_Blogger.Library;

namespace _24_Hour_Blogger.ViewModels.Content
{
    public partial class BloggerViewModel : ViewModelBase<Blogger>
    {

        public BloggerViewModel()
        {
            this.Entity = new Blogger();
        }

        DbContext dataContext = null;
        DbSet<Blogger> entitiesCollection = null;
        Blogger entityClass = null;
        public BloggerViewModel(DbContext dataContext, DbSet<Blogger> entitiesCollection, Blogger entityClass)
        //: base(dbContext, entitiesCollection, entityClass)
        {

            this.dataContext = dataContext;
            this.entitiesCollection = entitiesCollection;
            this.entityClass = entityClass;
            if (this.entityClass == null)
            {
                this.entityClass = new Blogger();
            }
            this.Entity = this.entityClass;
        }

        public override Int32 Id
        {
            get
            {
                return Entity.BloggerId;
            }
            set
            {

                Entity.BloggerId = value;


            }
        }

        public Int32 BloggerId
        {
            get
            {
                return Entity.BloggerId;
            }
            set
            {
                if (value > 0)

                    if (Entity.BloggerId != value)
                    {
                        Entity.BloggerId = value;
                        this.IsDirty = true;
                    }
            }
        }

        public String Twitter
        {
            get
            {
                return Entity.Twitter;
            }
            set
            {
                if (Entity.Twitter != value)
                {
                    Entity.Twitter = value;
                    this.IsDirty = true;
                }
            }
        }

        public String Bio
        {
            get
            {
                return Entity.Bio;
            }
            set
            {
                if (Entity.Bio != value)
                {
                    Entity.Bio = value;
                    this.IsDirty = true;
                }
            }
        }

        public String FaceBook
        {
            get
            {
                return Entity.FaceBook;
            }
            set
            {
                if (Entity.FaceBook != value)
                {
                    Entity.FaceBook = value;
                    this.IsDirty = true;
                }
            }
        }

        public String FavoriteQuote
        {
            get
            {
                return Entity.FavoriteQuote;
            }
            set
            {
                if (Entity.FavoriteQuote != value)
                {
                    Entity.FavoriteQuote = value;
                    this.IsDirty = true;
                }
            }
        }

        public String FavoriteWebsite
        {
            get
            {
                return Entity.FavoriteWebsite;
            }
            set
            {
                if (Entity.FavoriteWebsite != value)
                {
                    Entity.FavoriteWebsite = value;
                    this.IsDirty = true;
                }
            }
        }

        public String LinkedIn
        {
            get
            {
                return Entity.LinkedIn;
            }
            set
            {
                if (Entity.LinkedIn != value)
                {
                    Entity.LinkedIn = value;
                    this.IsDirty = true;
                }
            }
        }

        public int UserId
        {
            get
            {
                return Entity.UserId;
            }
            set
            {
                if (Entity.UserId != value)
                {
                    Entity.UserId = value;
                    this.IsDirty = true;
                }
            }
        }

        public override DateTime CreatedDate
        {
            get
            {
                return Entity.CreatedDate;
            }
            set
            {
                if (Entity.CreatedDate != value)
                {
                    Entity.CreatedDate = value;
                    this.IsDirty = true;
                }
            }
        }

        public override DateTime UpdatedDate
        {
            get
            {
                return Entity.UpdatedDate;
            }
            set
            {
                if (Entity.UpdatedDate != value)
                {
                    Entity.UpdatedDate = value;
                    this.IsDirty = true;
                }
            }
        }

        public override Int32 CreatedByUserId
        {
            get
            {
                return Entity.CreatedByUserId;
            }
            set
            {
                if (Entity.CreatedByUserId != value)
                {
                    Entity.CreatedByUserId = value;
                    this.IsDirty = true;
                }
            }
        }

        public override Int32 UpdatedByUserId
        {
            get
            {
                return Entity.UpdatedByUserId;
            }
            set
            {
                if (Entity.UpdatedByUserId != value)
                {
                    Entity.UpdatedByUserId = value;
                    this.IsDirty = true;
                }
            }
        }

        public String ScreenName
        {
            get
            {
                return Entity.ScreenName;
            }
            set
            {
                if (Entity.ScreenName != value)
                {
                    Entity.ScreenName = value;
                    this.IsDirty = true;
                }
            }
        }
    }
}